package com.budgetme.activities;

import java.util.Calendar;

import com.budgetme.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputType;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;


public class IncomeManager extends Activity {
	private static final String TAG = IncomeManager.class.getName();

	private int mIncomeId;
	private double mIncomeAmount;
	private double mIncomeTotal;
	private double mIncomeRemaining;
	private double mBudgetAllocated;
	private String mIncomeName;
		
	private TextView mIncomeTotalField;
	private TextView mIncomeRemainingField;
	
	private EditText mIncomeNameField;
	private EditText mIncomeAmountField;
	private Button mIncomeEdit;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Log.d(TAG, "onCreate");
		
		setContentView(R.layout.income_manager);
		
//		Intent starter = getIntent();
//		mIncomeId = starter.getIntExtra("income_id", -1);
//		
//		mBucketDatasource = new Datasource(this);
//		mBucketDatasource.open();
//		
//		mIncomeNameField = (EditText) findViewById(R.id.income_manager_income_name);
//		mIncomeAmountField = (EditText) findViewById(R.id.income_manager_income_amount);
//		mIncomeTotalField = (TextView) findViewById(R.id.income_manager_income_total);
//		mIncomeRemainingField = (TextView) findViewById(R.id.income_manager_income_remaining);
//		
//		mIncomeEdit = (Button) findViewById(R.id.income_manager_edit);
//		
//		update();
//		
//		mIncomeNameField.setInputType(InputType.TYPE_NULL);
//		mIncomeAmountField.setInputType(InputType.TYPE_NULL);
		
	}
	
	private void update() {
		
//        mIncomeTotal = mBucketDatasource.getIncomeMonthly();
//        mBudgetAllocated = mBucketDatasource.getBudgetAllocated();
//        
//        mIncomeRemaining = mIncomeTotal - mBudgetAllocated;
//		
//		mIncomeName = mBucketDatasource.getIncomeNameById(mIncomeId);
//		mIncomeAmount = mBucketDatasource.getIncomeAmount(mIncomeName);
//        
//        mIncomeTotalField.setText(String.format("%.0f", mIncomeTotal));
//        mIncomeRemainingField.setText(String.format("%.0f", mIncomeRemaining));
//        
//        mIncomeNameField.setText(mIncomeName);
//        mIncomeAmountField.setText(String.valueOf(mIncomeAmount));
        
	}
	
	@Override
	public void onDestroy() {
		super.onDestroy();
		Log.d(TAG, "onDestroy");
	}
	
	@Override
	public void onPause() {
		super.onPause();
		Log.d(TAG, "onPause");
	}
		
	@Override
	public void onResume() {
		super.onResume();
		Log.d(TAG, "onResume");
	}

}
